﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace LibFriesland_Campina_CRM
{
    public class BizProductInShopDiary
    {
        #region Thuoc tinh
        public long id { get; set; }
        public int by_shop { get; set; }
        public string by_product { get; set; }
        public DateTime datetime_diary { get; set; }
        public int quantity { get; set; }
        public decimal price { get; set; }
        #endregion

        #region Ham thiet lap
        public BizProductInShopDiary() { }
        public BizProductInShopDiary(long pId, int pBy_shop, string pBy_product, DateTime pDatetime_diary, int pQuantity)
        {
            id = pId;
            by_shop = pBy_shop;
            by_product = pBy_product;
            datetime_diary = pDatetime_diary;
            quantity = pQuantity;
        }
        #endregion

        #region Phuong thuc
        //Cap nhat so luong san pham cua cua hang trong kho
        public static int updateProductQuantityInShopDiary(string pBy_product, string pBy_shop, DateTime pDatetime, int pQuantity)
        {
            return DalProductInShopDiary.updateProductQuantityInShopDiary(pBy_product, pBy_shop, pDatetime, pQuantity);
        }
        #endregion

        #region Dung cho Webservice
        //Cap nhat gia ban le cua san pham tai cua hang
        public static int updateProductPriceInShopDiary(string pBy_shop, string pBy_product, DateTime pDatetime, decimal pPrice)
        {
            return DalProductInShopDiary.updateProductPriceInShopDiary(pBy_shop, pBy_product, pDatetime, pPrice);
        }
        #endregion

        #region Dung cho Report
        //Thong ke gia ban le san pham tai cua hang
        public static Dataset.DatasetPriceAudit getPriceAudit(DateTime pDatetime)
        {
            return DalProductInShopDiary.getPriceAudit(pDatetime);
        }

        //Lay thong tin so luong san pham cua cua hang theo ngay
        public static Dataset.DatasetProductInShop getProductQuantityInShopbyDate(DateTime pDatetime)
        {
            return DalProductInShopDiary.getProductQuantityInShopbyDate(pDatetime);
        }
        #endregion
    }
}
